package test02;

public class MountainTest extends Thread {
	private String name;
	private int time;

	public MountainTest(String name, int time) {
		this.name = name;
		this.time = time;
	}

	@Override
	public void run() {
		for (int i = 0; i < 10; i++) {
			try {
				Thread.sleep(time);
			} catch (Exception e) {
				// TODO: handle exception
				e.printStackTrace();
			}
			System.out.println(name+"爬完100米！");
		}
		System.out.println(name+"爬到终点");
	}
	public static void main(String[] args) {
		System.out.println("************开始爬山*************");
		Thread t1=new MountainTest("年轻人", 3000);
		t1.start();
		Thread t2=new MountainTest("老年人", 4000);
		t2.start();
	}
}
